<?php

/**
 * Odgovor form base class.
 *
 * @package    marketing
 * @subpackage form
 * @author     Your name here
 */
class BaseOdgovorForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'tekst_odgovora' => new sfWidgetFormInput(),
      'brojac'         => new sfWidgetFormInput(),
      'pitanje_id'     => new sfWidgetFormPropelChoice(array('model' => 'Pitanje', 'add_empty' => false)),
      'ponudjen'       => new sfWidgetFormInput(),
      'created_at'     => new sfWidgetFormDateTime(),
      'updated_at'     => new sfWidgetFormDateTime(),
      'deleted_at'     => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorPropelChoice(array('model' => 'Odgovor', 'column' => 'id', 'required' => false)),
      'tekst_odgovora' => new sfValidatorString(array('max_length' => 45)),
      'brojac'         => new sfValidatorInteger(),
      'pitanje_id'     => new sfValidatorPropelChoice(array('model' => 'Pitanje', 'column' => 'id')),
      'ponudjen'       => new sfValidatorInteger(),
      'created_at'     => new sfValidatorDateTime(array('required' => false)),
      'updated_at'     => new sfValidatorDateTime(array('required' => false)),
      'deleted_at'     => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('odgovor[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Odgovor';
  }


}
